function validate () {
	/**
	 * 1.校验是否有相同证件号码的乘机人
	 */
	var idNos = document.forms["customForm"].elements("idNo");
	if (idNos.length != undefined) {
		var idNoMap = new Map();
		for(i = 0; i < idNos.length; i++) {
			if(idNoMap.containsKey(idNos[i].value)) {
				alert("乘机人"+(i+1)+" 证件号码[" + idNos[i].value + "] 已存在，请核实");
				return false;
			} else {
				idNoMap.put(idNos[i].value, idNos[i].value);
			}
		}
	}
	
	/**
	 * 2.校验儿童人数是否超过4个，1个成人只能带一个儿童
	 */
	var t_count = $("#t_count").val();//成人机票数据
	var e_count = $("#e_count").val();//儿童机票数量
	
	if (t_count == 0) {
		alert("一张订单最少有一位乘机人且是成人票");
		return false;
	}
	if (e_count > t_count) {
		alert("一位成人只能带一位儿童");
		return false;
	}
	if (e_count > 4) {
		alert("儿童票不能超过4张");
		return false;
	}
	return true;
}

//返回到机票查询页面
function goSearchFlightBriefInfo() {
	document.forms["customForm"].action = "tc.do?m=sfbiform";
	document.forms["customForm"].submit();
}
//设置联系人在常用类型人框显示
/*function setLxr(c, tName, tContactPhone, tStreet, tProvince, tCity, tPostcode,tCounty,pDistrictCode) {
	alert(tName);
	alert(tContactPhone);
	alert(tStreet);
	alert(tProvince);
	alert(tCity);
	alert(tProvince);
	alert(pDistrictCode);
	if (c.checked == true) {
		var ss = document.getElementById("2336486");
	alert(ss);
		$("#Namecontact").val(tName);
		$("#contactPhone").val(tContactPhone);
		$("#street").val(tStreet);
		$("#p2336486").text("'"+tProvince+"'");
		$("#city").text(tCity);
		//$("#c1").text(tCity);
		$("#area").text(tCounty);
		//$("#a1").text(tCounty);
		$("#mailPostalcode").val(tPostcode);
	} else {
		$("#Namecontact").val("");
		$("#contactPhone").val("");
		$("#street").val("");
		$("#p1").text("");
		$("#city").text("");
		$("#area").text("");
		$("#mailPostalcode").val("");
	}
}*/
//设置联系人在常用类型人框显示
function editT(tName,tProvince,tCity,tStreet,tPostcode,tContactPhone,districtId,cDistrictId,pDistrictId) {
	if(tName !="null"){
		$("#Namecontact").val(tName);
	}
	if(tPostcode !="null"){
		$("#mailPostalcode").val(tPostcode);
	}
	if(tStreet != "null"){
		$("#street").val(tStreet);
	}
	if(tContactPhone != "null"){
		$("#contactPhone").val(tContactPhone);
	}
	$("#tCity").val(tCity);
	$("#tProvince option[districtId="+pDistrictId+"]").attr("selected", true);
	var districtCode = $("#tProvince").find("option:selected").attr("districtCode");
	
	$.ajax({  
		   type: "POST",   
		   url: "tc.do",
		   data:{
			    m:"queryCityRegion", 
			    districtGrade:"1",
				cDistrictId:cDistrictId,
				districtCode:districtCode
		   },
		   dataType:"json", 
		   async:false , 
		   success: function(data){
				   if(data.queryCity!=null && data.queryCity !=''){
					   $("#tCity").empty();
					   	var queryCity = data.queryCity;
				   		for(var i=0;i<queryCity.length;i++){
				   			$("#tCity").append("<option districtId='"+queryCity[i]["districtId"]+"' districtCode='"+queryCity[i]["districtCode"]+"' value='"+queryCity[i]["districtName"]+"'>"+queryCity[i]["districtName"]+"</option>");
				   		}
				   		$("#tCity option[districtId="+cDistrictId+"]").attr("selected", true);
				   	}else{
				   	 	$("#tCity").empty();
				   	}
			   
			   	
			   	if(data.queryArea != null && data.queryArea!=''){
			   		$("#tArea").empty();
			   		var queryArea = data.queryArea;
			   		for(var i=0;i<queryArea.length;i++){
			   			$("#tArea").append("<option districtId='"+queryArea[i]["districtId"]+"' districtCode='"+queryArea[i]["districtCode"]+"' value='"+queryArea[i]["districtName"]+"'>"+queryArea[i]["districtName"]+"</option>");
			   		}
			   		$("#tArea option[districtId="+districtId+"]").attr("selected", true);
			   	}else{
			   		$("#tArea").empty();
			   	}
			   
		   },
		   error:function(){
		   	   alert("error!");
		   }	 
	});
}
function setTakeValue(c) {
	if (c.checked == true) {
		c.value = "Y";
	} else {
		c.value = "N";
	}
}